﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using QLTV_Public;

namespace QLTV_Data
{
 public   class NgonNgu_Data
    {
     KetNoiCSDL_Data kn = new KetNoiCSDL_Data();
     public DataTable TaoBang(string sql)
     {
         return kn.taobang(sql);
     }
     public DataTable LayDuLieu()
     {
         return kn.LayDuLieu("Load_NgonNgu");
     }
     public int Insert(NgonNgu_Public maNgonNgu, NgonNgu_Public tenNgonNgu, NgonNgu_Public ghiChu)
     {
         int Npara = 3;
         string[] name = new string[Npara];
         object[] value = new object[Npara];
         name[0] = "@MaNgonNgu";
         value[0] = maNgonNgu.MaNgonNgu;
         name[1] = "@TenNgonNgu";
         value[1] = tenNgonNgu.TenNgonNgu;
         name[2] = "@GhiChu";
         value[2] = ghiChu.GhiChu;
         return kn.update("Insert_NgonNgu",name,value,Npara);
     }
     public int Update(NgonNgu_Public maNgonNgu, NgonNgu_Public tenNgonNgu, NgonNgu_Public ghiChu)
     {
         int Npara = 3;
         string[] name = new string[Npara];
         object[] value = new object[Npara];
         name[0] = "@MaNgonNgu";
         value[0] = maNgonNgu.MaNgonNgu;
         name[1] = "@TenNgonNgu";
         value[1] = tenNgonNgu.TenNgonNgu;
         name[2] = "@GhiChu";
         value[2] = ghiChu.GhiChu;
         return kn.update("Update_NgonNgu", name, value, Npara);
     }
     public int Delete(NgonNgu_Public maNgonNgu)
     {
         int Npara = 1;
         string[] name = new string[Npara];
         object[] value = new object[Npara];
         name[0] = "@MaNgonNgu";
         value[0] = maNgonNgu.MaNgonNgu;
         return kn.update("Delete_NgonNgu", name, value, Npara);
     }
    }
}
